package logic

import (
	"context"
	"doc-register/model"
	"doc-register/userrpc/internal/svc"
	"doc-register/userrpc/userrpc"

	"github.com/zeromicro/go-zero/core/logx"
)

type DocDelLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewDocDelLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DocDelLogic {
	return &DocDelLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *DocDelLogic) DocDel(in *userrpc.DocDelRequest) (*userrpc.DocDelResponse, error) {
	// todo: add your logic here and delete this line
	var doc model.Doc
	model.DB.Delete(&doc, in.DocId)
	return &userrpc.DocDelResponse{}, nil
}
